package com.boge.study.test.singlecase;

/**
 * 懒汉式单例类.在第一次调用的时候实例化自己
 * 线程不安全,并发环境下很可能出现多个Singleton实例
 * @author Administrator
 *
 */
public class Lazyton {

	private Lazyton() {}
	
	private static Lazyton instance = null;
	
	//静态工厂方法
	public static Lazyton getInstance() {
		if (instance == null) {
			instance = new Lazyton();
		}
		return instance;
	}
	
	public void method() {
		
	}
	
}
